console.log("-----------------cart.js loaded---------------");

//import libs
import Vue from 'vue'
import Vuex from 'vuex'

//use vuex
Vue.use(Vuex)

let state = {
  count: 3
}

const mutations = {
  add (context) {
    context.count++
  },
  decrease (context) {
    context.count--
  }
}

const actions = {
  add(add) {
    console.log("actios" + add);
    add.commit('add');
  },
  decrease (dec) {
    console.log(desc);
    decrease.commit('dec');
  } 
}

const getters = {
  cont (context) {
    console.log("gutters" + context);
    return context.count
  }
}

//output
export default new Vuex.Store({
  state,
  mutations,
  actions,
  getters
})